@@include('include/head.html')
<style>
h3{
    margin-bottom: 20px;
}
h3+.aiui-row{
    margin-bottom: 10px;
}
</style>
<div class="baui-tab baui-tab-brief baui-shadow" baui-filter="docDemoTabBrief">
    <div class="baui-tab-wrap">
        <div class="baui-tab-nav-scoll">
            <ul class="baui-tab-header">
                <li class="baui-active">消息提示</li>
            </ul>
        </div>
    </div>
    <div class="baui-tab-content">
        <h3>1.基本使用</h3>
        <div class="aiui-row">
            <button class="aiui-btn aiui-btn-default" id="info">普通消息</button>
            <button class="aiui-btn aiui-btn-success" id="success">成功提示</button>
            <button class="aiui-btn aiui-btn-warning" id="warning">警告提示</button>
            <button class="aiui-btn aiui-btn-error" id="error">错误提示</button>
        </div>
        <h3>2.自定义时间</h3>
        <div class="aiui-row">
            <button class="aiui-btn aiui-btn-default" id="sanmiao">1秒关闭</button>
        </div>
        <h3>3.添加关闭按钮</h3>
        <div class="aiui-row">
            <button class="aiui-btn aiui-btn-default" id="showclose">有关闭按钮</button>
            <button class="aiui-btn aiui-btn-default" id="showclose1">有关闭按钮且不自动关闭</button>
        </div>
        <h3>4.外部关闭</h3>
        <div class="aiui-row">
            <button class="aiui-btn aiui-btn-default" id="open">打开</button>
            <button class="aiui-btn aiui-btn-default" id="close">关闭</button>
        </div>
    </div>
</div>
<script>
aiui.use(['popup'],function(popup){
    document.getElementById('info').addEventListener('click',function(e){
        popup.message("这是普通提示");
    });
    document.getElementById('success').addEventListener('click',function(e){
        popup.message("这是成功提示",{
            icon:'success'
        });
    });
    document.getElementById('warning').addEventListener('click',function(e){
        popup.message("这是警告提示",{
            icon:'warning'
        });
    });
    document.getElementById('error').addEventListener('click',function(e){
        popup.message("这是错误提示",{
            icon:'error'
        });
    });
    document.getElementById('sanmiao').addEventListener('click',function(e){
        popup.message("1秒过后我就自动关闭了",{
            icon:'info',
            duration:'1000',
        });
    });
    document.getElementById('showclose').addEventListener('click',function(e){
        popup.message('显示关闭按钮',{
            icon:'info',
            showClose:true,
        });
    });
    document.getElementById('showclose1').addEventListener('click',function(e){
        popup.message('显示关闭按钮，并且不自动关闭',{
            icon:'info',
            showClose:true,
            duration:0,
        });
    });
    var index = '';
    document.getElementById('open').addEventListener('click',function(e){
        index = popup.message('这是外部关闭方法',{
            icon:'info',
            showClose:true,
            duration:0
        });
    });
    document.getElementById('close').addEventListener('click',function(e){
        popup.close(index);
    });
})
</script>
@@include('include/foot.html')